//
//  WD_RelatedModel.m
//  BUDING
//
//  Created by 景强 on 16/4/1.
//  Copyright © 2016年 HanWoonYong. All rights reserved.
//

#import "WD_RelatedModel.h"
@implementation WD_RelatedModel

- (instancetype)initWithDataSource:(NSDictionary *)dataSource
{
    self = [super initWithDataSource:dataSource];
    if (self) {
        [self setValuesForKeysWithDictionary:dataSource];
        NSMutableArray *arrayModel = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.images) {
            WD_imageModel *model = [[WD_imageModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            
            [arrayModel addObject:model];
        }
        
        self.images = [NSArray arrayWithArray:arrayModel];
        
    }
    return self;
}


- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"ep"]) {
        self.eps = [[WD_EpModel alloc] init];
        [self.eps setValuesForKeysWithDictionary:value];;
    }
    
}



@end
